Make gdk_surface_get_origin internal
authorMatthias Clasen <mclasen@redhat.com>
Wed, 29 May 2019 06:05:40 +0000 (02:05 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 29 May 2019 18:04:08 +0000 (18:04 +0000)
We still use this function inside gdk in
a number of places, so keep it around.

docs/reference/gdk/gdk4-sections.txt
gdk/gdkdisplay.c
gdk/gdkinternals.h
gdk/gdksurface.c
gdk/gdksurface.h

index fa1b832a4fadb47fc3b53ef3bfbc39b8afe3a93d..3aa9caa9ca7366cd1bdf0401f31abde2f5d6b9ee 100644 (file)
@@ -255,7 +255,6 @@ gdk_surface_set_type_hint
 gdk_surface_get_type_hint
 gdk_surface_set_shadow_width
 gdk_surface_get_position
-gdk_surface_get_origin
 gdk_surface_get_device_position
 GdkModifierType
 GdkModifierIntent
index 42444908949d38f9220d4cbaabd06c3b7cfb4985..2f5d729f796b5f0d0eff23a0b1e19948838e34fd 100644 (file)
@@ -1646,6 +1646,7 @@ gdk_display_get_monitor_at_surface (GdkDisplay *display,
         return best;
     }
 
+  /* the fallback implementation requires global coordinates */
   gdk_surface_get_geometry (surface, &win.x, &win.y, &win.width, &win.height);
   gdk_surface_get_origin (surface, &win.x, &win.y);
 
index 3b0e78cb494a589b4d6d5fe0b291ec5e1f8cbca4..ad9ca06e05893effb79646daa36621feea0458a4 100644 (file)
@@ -250,6 +250,10 @@ void gdk_surface_get_root_coords (GdkSurface *surface,
                                   gint        y,
                                   gint       *root_x,
                                   gint       *root_y);
+void gdk_surface_get_origin      (GdkSurface *surface,
+                                  gint       *x,
+                                  gint       *y);
+
 
 void gdk_surface_get_geometry (GdkSurface *surface,
                                gint       *x,
index 4e5620ff0759f844cf21d979bd10782071f2e85d..ba4c73a72f43f8eaedec2b0c877e29e86a097e32 100644 (file)
@@ -2419,37 +2419,28 @@ gdk_surface_get_height (GdkSurface *surface)
   return surface->height;
 }
 
-/**
+/*
  * gdk_surface_get_origin:
  * @surface: a #GdkSurface
- * @x: (out) (allow-none): return location for X coordinate
- * @y: (out) (allow-none): return location for Y coordinate
+ * @x: (out): return location for X coordinate
+ * @y: (out): return location for Y coordinate
  *
  * Obtains the position of a surface in root window coordinates.
  * (Compare with gdk_surface_get_position() and
- * gdk_surface_get_geometry() which return the position of a surface
- * relative to its parent surface.)
- *
- * Returns: not meaningful, ignore
+ * gdk_surface_get_geometry() which return the position
+ * of a surface relative to its parent surface.)
  */
-gint
+void
 gdk_surface_get_origin (GdkSurface *surface,
-                        gint      *x,
-                        gint      *y)
+                        gint       *x,
+                        gint       *y)
 {
-  gint dummy_x, dummy_y;
-
-  g_return_val_if_fail (GDK_IS_SURFACE (surface), 0);
-
-  gdk_surface_get_root_coords (surface,
-                               0, 0,
-                               x ? x : &dummy_x,
-                               y ? y : &dummy_y);
+  g_return_if_fail (GDK_IS_SURFACE (surface));
 
-  return TRUE;
+  gdk_surface_get_root_coords (surface, 0, 0, x, y);
 }
 
-/**
+/*
  * gdk_surface_get_root_coords:
  * @surface: a #GdkSurface
  * @x: X coordinate in surface
index 5d0463da0a2a71e3ae728b38c4578feb0585457c..c93b3edba47b88a598e9b5f622dad743150256a5 100644 (file)
@@ -553,10 +553,6 @@ void          gdk_surface_get_position   (GdkSurface      *surface,
                                           gint            *x,
                                           gint            *y);
 GDK_AVAILABLE_IN_ALL
-gint          gdk_surface_get_origin     (GdkSurface      *surface,
-                                          gint            *x,
-                                          gint            *y);
-GDK_AVAILABLE_IN_ALL
 gboolean gdk_surface_translate_coordinates (GdkSurface *from,
                                             GdkSurface *to,
                                             double     *x,